package math.spbu.ru.historycharts.model;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DatePoint {
	private Calendar date;
	private float value;

	public DatePoint(Calendar date, float value) {
		this.date = date;
		this.value = value;
	}

	public DatePoint(Date date, double value) {
		this.date = new GregorianCalendar();
		this.date.setTimeInMillis(date.getTime());
		this.value = (float) value;
	}

	public Calendar getDate() {
		return date;
	}

	public float getValue() {
		return value;
	}

	public void setDate(Calendar date) {
		this.date = date;
	}

	public void setValue(float value) {
		this.value = value;
	}

	public String toString() {
		return String.format("%.2f", value) + " \n"
				+ String.format("%.12s", date.getTime().toLocaleString());
	}
}
